<template>
  <div class="phonetic-symbol-container">
    <el-skeleton :rows="15" animated v-if="loading" />
    <iframe v-show="!loading" src="/phonetic-symbol.html" frameborder="0" @load="onIFrameLoad">
    </iframe>
    <el-link v-show="!loading" type="primary" class="phonetic-symbol-link" target="_blank"
      href="https://thesoundofenglish.org/wp-content/uploads/in5-archives/interactive-ipa-chart-22/Interactive%20IPA%20Chart%2022/index.html">
      页面内来源 [https://thesoundofenglish.org/]
    </el-link>
  </div>
</template>

<script>
import { ElSkeleton, ElLink } from 'element-plus'

export default {
  name: 'PhoneticSymbol',
  components: {
    ElSkeleton,
    ElLink
  },
  data() {
    return {
      loading: true
    }
  },
  methods: {
    onIFrameLoad() {
      this.loading = false
    }
  }
}
</script>

<style scoped>
iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.phonetic-symbol-link {
  margin: 0px auto;
  display: block;
  text-align: center;
}

.phonetic-symbol-container {
  padding: 0;
  height: calc(100vh - 120px);
}

@media (max-width: 768px) {
  .phonetic-symbol-container {
    padding: 10px;
    height: calc(100vh - 80px);
  }
}
</style>